import time
from src.core.rfq_controller import RFQController
from src.core.pv_config import PV_CONFIG, PRESET_PARAMETERS

def main():
    """主程序入口"""
    try:
        # 初始化RFQ控制器
        rfq = RFQController(PRESET_PARAMETERS, PV_CONFIG)
        print("RFQ自动加载系统初始化完成")
        

        
        # 主循环
        while True:
            rfq.update()
            time.sleep(1)
            
    except KeyboardInterrupt:
        print("\n程序已停止")
    except Exception as e:
        print(f"发生错误: {str(e)}")
        
if __name__ == "__main__":
    main() 